1. Technical Field
This invention is generally directed to a filesystem for use in a computer, embedded controller, processing system, or the like. More particularly, this invention is directed to a filesystem having a filename cache.
2. Related Art
Computers, embedded controllers, and other microprocessor based systems are typically constructed from a variety of different hardware components. The hardware components may include a processor, I/O devices, human interface devices, and the like. Additionally, such systems use memory storage units to maintain the data used in the system. The memory storage units may take on a variety of different forms including, but not limited to, hard disk drives, floppy disk drives, random access memory, flash memory, and the like.
High-level application programs that are executed in such systems must often interact seamlessly with these hardware components, including the memory storage units. To this end, many systems run an operating system that acts as an interface between the application programs and the system hardware. Filesystem software may be included as part of the operating system or it may be provided as an ancillary software component that interacts with the operating system. In either instance, the filesystem software organizes the data within the memory storage units for ready access by the processor and the high-level application programs that the processor executes.
The filesystem software may employ a file/directory layer that organizes the contents of files and directories into equal-sized logical blocks of contiguous data. Each logical block has an association with one or more corresponding physical blocks on the storage device where the data is actually retained. The file/directory layer executes updates to the filesystem by identifying every block that needs to be updated in response to a request and rewriting the entire contents of each such block. The file/directory layer reads the contents of files and directories by reading the entire contents of every block that holds a portion of the region of data to be read.
The filesystem also may include a storage layer that maps the virtual addresses of filesystem contents to physical blocks of data on the data storage device. The storage layer may execute logical block read requests from the file/directory layer by determining the correct physical block(s) associated with the request and reading its contents from the data storage device. Similarly, the storage layer may execute right requests by either updating contents of an existing physical block(s), or by allocating an unused physical block from the data storage device to the logical block and then updating the contents of the physical block.
The filesystem also may be responsible for locating a file in data storage using, for example, a filename associated with the file. Systems such as UNIX employ a filename cache in which a fixed number of bytes are allocated to each filename for this purpose. This system may be wasteful of memory space when the filenames are short and may result in ambiguous hits for long filenames that have been truncated to fit into the fixed byte allocation. Accordingly, there is a need for an improved filename caching system.